<div class="grid_4">       
    <div class="da-panel">
        <div class="da-panel-header">
            <span class="da-panel-title">
                Danh mục cẩm nang
            </span>
        </div>

        <div id="da-ex-tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
            <?php // $this->renderPartial('_tabs', array('model' => $model))?>
            <div style="padding-bottom: 20px;">
<?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'comment-form',
        'enableClientValidation'=>true,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        ),
        'enableAjaxValidation'=>false,
        'htmlOptions' => array('class' => 'stdform stdformsmall')
    )); ?>                
            <div class="par control-group">
                <?php echo $form->labelEx($model,'name', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model,'name',array('maxlength'=>255, 'class' => 'input')); ?>
                    <?php echo $form->error($model,'name');?>
                </div>
            </div>
            <div class="par control-group">
                <?php echo $form->labelEx($model,'alias', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model,'alias',array('maxlength'=>255, 'class' => 'input')); ?>
                    <?php echo $form->error($model,'alias');?>
                </div>
            </div>
            <div class="par control-group">
                <?php echo $form->labelEx($model,'parent_id', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->dropDownList($model,'parent_id',  HandbookPostCat::model()->getData(),array('size'=>5, 'class' => 'input')); ?>
                    <?php echo $form->error($model,'alias');?>
                </div>
            </div>
            <div class="par control-group">
                <?php echo $form->labelEx($model,'index', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model,'index',array('maxlength'=>255, 'class' => 'input')); ?>
                    <?php echo $form->error($model,'index');?>
                </div>
            </div>
            <p class="stdformbutton">
                    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-info')); ?>
            </p>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>
</div>
<script>
    $(function(){
            <?php if($model->isNewRecord):?>
            $('#HandbookCat_name').bind('blur keyup', function() {
                    $('#HandbookCat_alias').val($(this).val().toAlias().replaceAll(' ', '-').toLowerCase());
            });
            <?php endif?>
                });
</script>